import sqlite3
import os.path

class base_repository:

    @classmethod
    def insert(self, item):
        try:
            db_conn = self.initializedb(self.db_file)
            print "Inserting in ",  self.db_file
        except Exception as e:
            print "Error opening db ",  self.db_file, e
            sys.exit(1)

    @classmethod
    def initializedb(self, db_file):
        try:
            os.path.isfile(db_file)
            return sqlite3.connect(db_file)
        except:
            raise ValueError

class inventory_repository(base_repository):
    db_file = 'store_inventory.db'

class customer_repository(base_repository): 
    db_file = 'store_customer.db'
